home *** CD-ROM | disk | FTP | other *** search
- Path: gizmo.cs.msstate.edu!shekar
- From: shekar@gizmo.cs.msstate.edu (Shekar Ramanathan)
- Newsgroups: gnu.g++.help,comp.lang.c++
- Subject: Re: IS THIS LEGAL? Static method returns pointer to class
- Followup-To: gnu.g++.help,comp.lang.c++
- Date: 4 Mar 1996 12:41:55 GMT
- Organization: Mississippi State University
- Message-ID: <4heoej$70v@NNTP.MsState.Edu>
- References: <4hdu70$efa@panix.com>
- NNTP-Posting-Host: gizmo.cs.msstate.edu
- X-Newsreader: TIN [version 1.2 PL0]
-
- Arthur Cinader Jr (acinader@panix.com) wrote:
-
- > The parameters are checked and if all is ok, a Triangle
- > instance is "newed" and the pointer to the new Trinagle is
- > returned. When I compile, I get the following error:
-
- > % g++ -c triangle.C
- > In file included from triangle.C:8:
- > triangle.h:17: syntax error before `*'
- > ...
- > %
-
- > ***The declaration for the class:
-
- [...]
-
- > 10 class Trianlge : public Point {
- ^^^^^^^^
- If you included the exact code, the above typo may be the culprit.
-
- And IMHO, I think a Triangle is not "is-a" Point but rather it is
- composed of points. So I think Triangle should not inherit from Point.
- Just a thought.
-
- Shekar
-
- --
- ---------------------------------------------------------------------
- Shekar Ramanathan | mailto:shekar@CS.MsState.edu
- Department of Computer Science | http://www.cs.msstate.edu/~shekar
- Mississippi State University |
-
- For the latest in World Cup Cricket, finger shekar@cs.msstate.edu
- ---------------------------------------------------------------------
-